package fpzhan.plane.program.connect;

import fpzhan.plane.program.compose.CodeBlockCompose;
import fpzhan.plane.program.proxy.CodeBlockProxy;
import fpzhan.plane.program.struct.CodeBlockStruct;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public abstract class CodeBlockConnect {

    private Object source;


    protected class CurrentCodeBlockConnectContext {
        final private Map<String, List<CodeBlockCompose>> beginFlow = new HashMap<>();


        public Map<String, List<CodeBlockCompose>> getBeginFlow() {
            return beginFlow;
        }


    }

    private CurrentCodeBlockConnectContext current = new CurrentCodeBlockConnectContext();

    private CodeBlockContext context;

    public CodeBlockConnect(CodeBlockContext context, Object source) {
        this.context = context;
        this.source = source;
    }


    protected Map<String, List<CodeBlockCompose>> getFinishFlow() {
        return this.context.getFinishFlow();
    }

    protected List<CodeBlockProxy> getProxys() {
        return this.context.getProxys();
    }

    protected CurrentCodeBlockConnectContext getCurrent() {
        return current;
    }

    protected Object getSource() {
        return source;
    }


    public CodeBlockStruct getStruct() {
        return this.context.getStruct();
    }

    public CodeBlockContext getContext() {
        return context;
    }


}
